package com.xyy.saas.payment.cashier.core.bo;

import com.xyy.saas.payment.common.Builder;
import com.xyy.util.StringUtil;

import java.io.Serializable;

/**
 * 收银台预支付返回结果
 * @author dake
 * @date 20200326
 */
public class CashierPrePayBO implements Serializable {

    private static final long serialVersionUID = 606689627258518818L;

    /**
     * 交易单
     */

    private String payNo;


    private String payNoToken;


    public static CashierPrePayBO instance(String payNo, String payNoToken) {
        return Builder.of(CashierPrePayBO::new)
                .with(CashierPrePayBO::setpayNo, payNo)
                .with(CashierPrePayBO::setPayNoToken, payNoToken)
                .build();
    }

    public com.xyy.saas.payment.cores.bo.CashierPrePayBO convert2ApiBo() {
        return Builder.of(com.xyy.saas.payment.cores.bo.CashierPrePayBO::new)
                .with(com.xyy.saas.payment.cores.bo.CashierPrePayBO::setPayNo, payNo)
                .with(com.xyy.saas.payment.cores.bo.CashierPrePayBO::setPayNoToken, payNoToken)
                .build();
    }

    public boolean isEmpty() {
        return StringUtil.isEmpty(payNo);
    }

    public String getpayNo() {
        return payNo;
    }

    public void setpayNo(String payNo) {
        this.payNo = payNo;
    }

    public String getPayNoToken() {
        return payNoToken;
    }

    public void setPayNoToken(String payNoToken) {
        this.payNoToken = payNoToken;
    }
}
